<?php 
$lang =& JFactory::getLanguage();

//echo JText::_('CONTACT');
//$template_dir = $this->baseurl.'/templates/mwc_careitec/assets/';
$template_dir = '/templates/mwc_careitec/assets/';
jimport('mylibs.function');
jimport('mylibs.globalModel');
$globalModel = new globalModel();
 ?>
<style>
    .required-field{color:#FF0000}
</style>

<div id="main" class="p15t">
  <div class="b_bg_tt_sub2">
    <h2 class="p5t float_left"><?php echo JText::_('BOOK_MEETING'); ?> </h2>
    <p class="float_right p5t" style="display:none"><a href="#"><img src="<?php echo $template_dir; ?>images/tilbage_icon.png" alt="" /> Tilbage</a></p>
    <br style="clear:both" />
  </div>
  <div class="b_box_allbook">
    <div class="b_allbox_left">
      <div class="b_allbox_right">
        <div class="b_form_book"> <img src="<?php echo $template_dir; ?>images/b_icon_info.png" style="float:left; margin-right:10px" />
          <?php 
          	$dataContent = $globalModel->getArticle(135);          	
          	//echo JText::_('MESSAGE1');
          	echo $dataContent[0]['introtext']; 
          ?>
          <p class="cb"></p>
		  <form action="<?php echo JRoute::_( 'index.php', true, $this->params->get('usesecure')); ?>" method="post" name="comBook" id="comFormBooking">
          <div class="p15t">
            <label><?php echo JText::_('BOOK_NAME'); ?>&nbsp;<span class="required-field">*</span></label>
            <input name="name" id="name" class="b_txt_book w309 float_left" type="text" />
            <br class="cb" />
            <label><?php echo JText::_('BOOK_CONTACT'); ?></label>
            <input name="contactperson" id="contactperson" class="b_txt_book w309 float_left" type="text" />
            <br class="cb" />
            <label><?php echo JText::_('BOOK_ADDRESS'); ?>&nbsp;<span class="required-field">*</span></label>
            <input name="address" id="address" class="b_txt_book w309 float_left" type="text" />
            <br class="cb" />
            <label><?php echo JText::_('BOOK_POSTCODE'); ?></label>
            <input name="postnumber" id="postnumber" class="b_txt_book w309 float_left isnumber" type="text" maxlength="4" />
            <br class="cb" />
            <label><?php echo JText::_('BOOK_CITY'); ?></label>
            <input name="by" id="by" class="b_txt_book w309 float_left" type="text" />
            <br class="cb" />
            <label><?php echo JText::_('BOOK_EMAIL'); ?>&nbsp;<span class="required-field">*</span></label>
            <input name="email" id="email" class="b_txt_book w309 float_left" type="text" />
            <br class="cb" />
            <label><?php echo JText::_('BOOK_PHONE'); ?>&nbsp;<span class="required-field">*</span></label>
            <input name="phone" id="phone" class="b_txt_book w309 float_left isnumber" type="text"  maxlength="15" />
            <br class="cb" />
            <label><?php echo JText::_('BOOK_MEETING_DATE'); ?></label>
            <input name="date" id="date" class="b_txt_book w275 float_left" type="text" />
            <img src="<?php echo $template_dir; ?>images/b_icon_calenda.png"/> <br class="cb" />
            <label><?php echo JText::_('BOOK_MEETING_TIME'); ?></label>
            <input name="time" id="time" class="b_txt_book w275 float_left" type="text" />
            <img src="<?php echo $template_dir; ?>images/b_icon_clock.png"/><br class="cb" />
            <label><?php echo JText::_('BOOK_DESC'); ?>&nbsp;<span class="required-field">*</span></label>
            <textarea class="w309" name="message" id="message" cols="" rows=""></textarea>
            <br class="cb" />
            <!--
            <div class="p15b">
              <table width="100%" border="0" cellspacing="0" cellpadding="0" >
                <tr>
                  <td width="28%">&nbsp;</td>
                  <td width="30%" valign="top"><input type="checkbox" name="checkbox[]" id="checkbox" value="The perfect match" />
                    The perfect match</td>
                  <td width="42%" valign="top"><input type="checkbox" name="checkbox[]" id="checkbox" value="Hosting / Co-location" />
                    Hosting / Co-location</td>
                </tr>                
                <tr>
                  <td>&nbsp;</td>
                  <td valign="top"><input type="checkbox" name="checkbox[]" id="checkbox" value="It-drift og driftsstøtte" />
                    It-drift og driftsstøtte</td>
                  <td valign="top"><input type="checkbox" name="checkbox[]" id="checkbox" value="Helpdesk og Support"  />
                    Helpdesk og Support</td>
                </tr>                   
                <tr>
                  <td>&nbsp;</td>
                  <td valign="top"><input type="checkbox" name="checkbox[]" id="checkbox" value="Katastrofeberedskab"  />
                    Katastrofeberedskab</td>
                  <td valign="top"><input type="checkbox" name="checkbox[]" id="checkbox" value="Bestil en uforpligtende gennemgang af jeres it-installation"  />
                    Bestil en uforpligtende 
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gennemgang af jeres<br />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; it-installation</td>
                </tr>                
              </table>
            </div>
            --> 
            <label>&nbsp;</label>
            <input name="" type="image" src="<?php echo $template_dir; ?>images/b_bt_send.png" />
            <input onclick="document.comBook.reset();return false;" name="" type="image" src="<?php echo $template_dir; ?>images/b_bt_nulstil.png" />
				<input type="hidden" name="option" value="com_user" />
	<input type="hidden" name="task" value="booking" />
	<input type="hidden" name="return" value="<?php echo $this->return; ?>" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<script language="javascript">
<?php
if( $lang->getName()=="Danish(DK)")
{
?>
jQuery(function($){
    $.datepicker.regional['da'] = {
		closeText: 'Luk',
        prevText: '&#x3c;Forrige',
		nextText: 'Næste&#x3e;',
		currentText: 'Idag',
        monthNames: ['Januar','Februar','Marts','April','Maj','Juni',
        'Juli','August','September','Oktober','November','December'],
        monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
        'Jul','Aug','Sep','Okt','Nov','Dec'],
		dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
		dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
		dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
		weekHeader: 'Uge',
        dateFormat: 'dd-mm-yy',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: ''};
    $.datepicker.setDefaults($.datepicker.regional['da']);
    
    $.timepicker.regional['da'] = {
        timeOnlyTitle: 'Vælg tid ved at skubbe',
        timeText: 'Valgte tid',
        hourText: 'Time',
        minuteText: 'Minut',
        secondText: 'Sekund',
        currentText: 'Nu',
        closeText: 'Udført'//,
        //ampm: true,
        //hourMin: 6,
        //hourMax: 18
    };
    $.timepicker.regional['en'] = {
        timeOnlyTitle: 'Choose time',
        timeText: 'Time',
        hourText: 'Hour',
        minuteText: 'Minute',
        secondText: 'Second',
        currentText: 'Now',
        closeText: 'Done'//,
        //ampm: true,
        //hourMin: 6,
        //hourMax: 18
    };               
    $.timepicker.setDefaults($.timepicker.regional['da']); 
});

<?php
}
?>
$(document).ready(function(){
    $('#date').datepicker( $.datepicker.regional[ "da" ] );  
    $('#time').timepicker( $.timepicker.regional[ "da" ] );
    
	$('#nav_main .item48').attr('id', 'current');
	// only numbers allow with the field has alt='number'
	$('#comFormBooking .isnumber').keydown(function(event) 
	{
		if ( event.keyCode == 46 || event.keyCode == 8 ) 
		{
		} 
		else 
		{
			if (event.keyCode < 95) 
			{
				if (event.keyCode < 48 || event.keyCode > 57 ) 
				{
					event.preventDefault();
				}
			} 
			else 
			{
				if (event.keyCode < 96 || event.keyCode > 105 ) 
				{
					event.preventDefault();
				}
			}
		}
	}); 
/*if ($("#txtBox").val().length < 10) 
$("#txtBox_warning").append("Minimum 10 Characters are required");
*/            

    $('#comFormBooking').submit(function(){
		var name = $('#name').val();
		var address = $('#address').val();
		var email = $('#email').val();
		var phone = $('#phone').val();
		var text = $('#message').val();
		if(name=="")
		{
			show_popup('<?php echo JText::_( 'NAME_ERROR' ); ?>','name');
			return false;	
		}
		if(address=="")
		{
			show_popup('<?php echo JText::_( 'ADDRESS_ERROR' ); ?>','address');
			return false;	
		}
		if (!IsValidEmail(email) || email=='')
		{	
			show_popup('<?php echo JText::_( 'EMAIL_ERROR' ); ?>','email');
			return false;	
		}
		if(phone=="")
		{
			show_popup('<?php echo JText::_( 'PHONE_ERROR' ); ?>','phone');
			return false;	
		}
		if(text=="")
		{
			show_popup('<?php echo JText::_( 'MESSAGE_ERROR' ); ?>','message');
			return false;	
		}
    });
});
function IsValidEmail(email)
{
	var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
	return filter.test(email);
}
</script>

<div id="footer" class="bg_foot_sub">
<!-- 
  <embed src="<?php //echo $this->baseurl; ?>/media/music/funktionstast_logolyd_2sek.mp3" autostart="true" loop="false" hidden="true" volume="10"> </embed>
-->  
  <div class="w950 mc p15t p15b">
    <p class="float_left">Copyright © 2010 <a href="<?php echo $this->baseurl; ?>">CAREITEC.DK</a>. All rights reserved.</p>
    <p class="float_right">Design by <a href="http://www.mywebcreations.dk/" target="_blank">My Web Creations</a></p>
    <br style="clear:both" />
  </div>
</div>
</div>
</div>
